package com.mccken.common;

import com.mccken.springframework.beans.PropertyValue;
import com.mccken.springframework.beans.PropertyValues;
import com.mccken.springframework.beans.factory.ConfigurableListableBeanFactory;
import com.mccken.springframework.beans.factory.config.BeanDefinition;
import com.mccken.springframework.beans.factory.config.BeanFactoryPostProcessor;

/**
 * @program: mccken-collect
 * @description:
 * @author: mccken
 * @create: 2022-12-28 00:33
 **/
public class MyBeanFactoryPostProcessor implements BeanFactoryPostProcessor {
	@Override
	public void postProcessorBeanFactory(ConfigurableListableBeanFactory beanFactory) {
		BeanDefinition beanDefinition = beanFactory.getBeanDefinition("userService");
		PropertyValues propertyValues = beanDefinition.getPropertyValues();
		propertyValues.addPropertyValue(new PropertyValue("company", "改为：字节跳动"));
	}
}
